<template>
    <div class="page-container">
        <p>缓存：<span>{{user.realName}}</span></p>
        <p>刷新：<span>{{loginUser.realName}}</span></p>
    </div>
</template>
<script>
import { mapGetters } from 'vuex'
import * as Login from '@/api/login'

export default {
  data() {
    return {
      loginUser: {}
    }
  },
  mounted() {
    this.getProfile()
  },
  computed: {
    ...mapGetters(['user'])
  },
  methods: {
    getProfile() {
      Login.getInfo().then(data => {
        this.loginUser = data.data
      }).catch(err => this.$message.error(err.message || err))
    }
  }
}
</script>
